#include<iostream>
#include<cstdio> 
#include<algorithm>
using namespace std;
const int maxn=64;
int n,m;
int a[maxn],b[maxn];
unsigned long long status,trans;
bool win;
int main(){
	scanf("%d%d",&n,&m);
	for(int i=0;i<n;++i)
		scanf("%d%d",&a[i],&b[i]);
	for(int i=0;i<n;i++)
		for(int j=i+1;j<n;j++)
			if(a[i]>a[j]){
				swap(a[i],a[j]);
				swap(b[i],b[j]);
			}
	//(1)
	status=~0ull^1;
	trans=0;
	for(int i=1,j=0;i<=m;i++){
		//(2)
		while(j<n&&a[j]==i){
		//(3)
			trans|=1ull<<(b[j]-1);
			cout<<"trans:"<<trans<<endl;
			
			++j;
		}
		//(4)
		win=~status&trans;
		cout<<"i:"<<i<<"win:"<<win<<endl;		
		//(5)		
		status=status<<1^win;
		cout<<"i:"<<i<<"status:"<<status<<endl;				
	}
	puts(win?"win":"loss");
	return 0;
}
